$(function () {
    $("[detail='true']").live("dblclick", function () {
        if ($(this).parent().attr("id") == "win_details") {
            winDetail.window("close");
            return;
        }
        if($(this).closest(".window-body").length){
            return;
        }
        var detailParent = $(this).parent();
        var detail = $(this);
        winDetail = $.window({
            title: "详细",
            iconCls: 'icon-tip',
            width: $(this).width() + 10,
            height: 500,
            maximizable:true,
            contents: "<div id='win_details' style='height:98%'></div>",
            onClose: function () {
                detailParent.append(detail);
                if (detail.data("tabs") != null) {
                    detail.tabs("resize");
                }
            }
        });
        $("#win_details").append(detail);
        if (detail.data("tabs") != null) {
            detail.tabs("resize");
        }
    });
});

